﻿using System;
using System.Collections.Generic;

namespace AliCMS.UserModule
{
    public interface IInstanceConfig : IObject
    {
        bool HasRight(object user, int instanceInnerID, Guid? subInstanceID, string lang, object objectIDOrName, object operationIDOrName, Guid recordID);
    }
    public interface IUser : IDbObject
    {
        void ModifyPassword(int id, string oldPassword, string validationString, string newPassword);

        void Lock(int id);
        void UnLock(int id);
        void Recycle(int id);
        void Recover(int id);
        void Check(int id);

        bool IsNameExist(string name);
        bool IsMobileExist(string mobile);
		bool IsWxUnionIDExist(string wxUnionId);
		bool IsWxppOpenIDExist(string wxppOpenId);
		bool IsWxmpOpenIDExist(string wxmpOpenId);

        Guid Register(Dictionary<string, object> item, string checkCode);
		Dictionary<string, string> Login(string name, string password, int minutes, string checkCode);
		Dictionary<string, string> LoginByWxmp(string code);
		Dictionary<string, string> LoginByMobileOnWxmp(string mobile, string code);

        void SendMobileValidation(string name);

		bool ValidatePassword(int id, string password);

        void UploadHead(string fieldName, ref string uploadFile, bool isLast);
    }
    namespace User
    {
        public interface IMoney : IDbObject
        {
            decimal GetBalance(Guid userId);
            decimal GetAllBalance(Guid userId);
            decimal GetDrawableBalance(Guid userId);

            decimal GetIncome(Guid userId, int days);

            #region 用户统计
            string User_StatSumOne(Guid userId, Dictionary<string, object> data);
            string User_StatSumAll(Dictionary<string, object> data);
            string User_StatSumHourly(Guid userId, Dictionary<string, object> data);
            string User_StatSumDaily(Guid userId, Dictionary<string, object> data);
            string User_StatSumMonthly(Guid userId, Dictionary<string, object> data);
            #endregion
        }
    }
}
